#ifndef __AW_BODY
#define __AW_BODY

class AW_Body : public AW_Entity {
public:
	AW_Body(Ontology *O,FTKBase *Memory);
	AW_Body(FILE *fp,Ontology *O,FTKBase *Memory);

	virtual ~AW_Body();

	virtual bool load(FILE *fp);
	virtual bool save(FILE *fp);

	virtual bool is_a(char *c);
	virtual bool is_a(Symbol *c);

	virtual void draw(void);
	virtual void draw_body(void);
	virtual void draw_shadows(float lightpos[4]);
	virtual void draw_body_shadows(float lightpos[4]);
	virtual void localdraw(void);

	virtual void actualize(float time,float timeinc,List<AW_Message> *message_queue);

	virtual Vector get_pos() {
		return m_pos;
	} /* get_pos */ 
	Vector get_dir() {
		Vector v(0.0,0.0,1.0),v2;
		m_d.rotate_vector(v,v2);
		return v2;
	} /* get_dir */ 
	Quaternion get_direction() {return m_d;}

	List<FeatureTerm> *ObtainOps();
	bool ValidOperator(FeatureTerm *op);
	virtual bool ApplyOperator(FeatureTerm *op,float time,class AW_Agent *a,class AW_World *w);
	virtual void get_matrix(float m[16]);

	virtual bool MouseClick(int x,int y);
	virtual bool KeyboardEvent(int key);
	
protected:
	virtual void operators(void);
	
	List<FeatureTerm> m_ops;
	Vector m_pos;				/* Position */ 
	Quaternion m_d;				/* Direction */ 

	List<AW_LocalViewport> m_local_viewports;

	Ontology *m_ontology;
	FTKBase *m_memory;

private:


}; /* AW_Body */ 

#endif

